home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gsview08.zip / GSVIEW.DOC < prev    next >
Text File  |  1993-07-06  |  33KB  |  807 lines

  1. 1Overview
  2. ?Overview
  3.  `Ghostview for Windows` is a graphical interface for MS-Windows `Ghostscript`.
  4.  Ghostscript is an interpreter for the PostScript page description language
  5.  used by laser printers.
  6.  For documents following the Adobe PostScript Document Structuring
  7.  Conventions, Ghostview for Windows allows selected pages to be viewed or
  8.  printed.
  9.  Ghostview for Windows can be used with Windows Ghostscript 2.6 or later.
  10.  Ghostview for Windows was inspired by Tim Theisen's X11 Ghostview
  11.  program.
  12.  The ability to understand `DSC` comments comes from X11 Ghostview.
  13.  
  14. 2Document Structuring Conventions
  15. ?Document Structuring Conventions
  16. ?DSC
  17. ?Encapsulated PostScript
  18. ?EPSF
  19. ?EPS
  20.  Adobe has defined a set of extended comment conventions that provide
  21.  additional information about the page structure and resource
  22.  requirements of a postscript file.
  23.  If a file contains these Document Structuring Convention (DSC) comments,
  24.  Ghostview can display pages in random order using `Goto` and display pages
  25.  in reverse order using `Prev`.  Selected pages can be extracted to
  26.  another file or printed.
  27.  
  28.  If a file does not contain DSC comments, Ghostview can only
  29.  display the pages in the original order.
  30.  
  31.  DSC conforming files start with the comment line:
  32.   %!PS-Adobe-3.0
  33.  where the number 3.0 may change and is the DSC version number.
  34.  Some programs write postscript files with a control-D as the first
  35.  character of the file, followed by the comment line mentioned above.
  36.  Ghostview will correctly report that these files are not DSC conforming,
  37.  but will still display them with page selection features available.
  38.  Complain to the author of the program that produced the postscript file.
  39.  To make the file DSC conforming, edit it to remove the control-D character.
  40.  
  41.  DSC conforming files contain lines such as:
  42.   %%Pages: 24
  43.   %%Page: 1 1
  44.  These lines tell Ghostview how many pages a document contains and
  45.  where they start.  Ghostview uses this information to select
  46.  individual pages.
  47.  
  48.  Encapsulated PostScript Files (EPSF) are single page documents
  49.  that contain a subset of the `DSC` comments and PostScript commands.
  50.  EPS files start with the comment line:
  51.   %!PS-Adobe-3.0 EPSF-3.0
  52.  EPS files are commonly used for inclusion in other documents and
  53.  for this reason require the bounding box comment:
  54.    %%BoundingBox: llx lly urx ury
  55.  where llx, lly, urx and ury are integers giving the x and y coordinates
  56.  of the lower left and upper right corners of a bounding box which encloses
  57.  all marks made on the page.
  58.  
  59.  Some EPS files contain a preview of the postscript document.
  60.  This preview can be a Windows Metafile, a TIFF file, or an Interchange
  61.  preview (EPSI format).
  62.  For the Windows Metafile or TIFF file preview, the EPS file under DOS
  63.  contains a binary header which specifies the location and lengths of
  64.  the preview and postscript language sections of the EPS file.
  65.  For the Interchange format, the preview is contained in DSC comments
  66.  starting with
  67.   %%BeginPreview: width height depth lines
  68.  An EPS file with a preview can be created from an EPS file without a
  69.  preview using `Add EPS Preview`
  70. 2Opening a Document
  71. ?File
  72. ?Open
  73. ?Select File
  74. ?Close
  75.  The `Open` command on the `File` menu opens a file and displays
  76.  the first page.
  77.  
  78.  If the file contains `DSC` comments, pages can be selected using
  79.  `Next`, `Prev` and `Goto`.
  80.  
  81.  If the file does not contain `DSC` comments, `Prev` and `Goto` will
  82.  not work.  Another file should not be selected until a last page of
  83.  the file has been displayed.
  84.  
  85.  When a file is open, Ghostview will display the document filename,
  86.  the current page (if available) and while the cursor is over
  87.  the image, the location of the cursor in default user coordinates
  88.  (1/72 inch).
  89.  The cursor location is useful for calculating bounding boxes.
  90.  
  91.  The `Select File` command is similar to `Open` but it does not display
  92.  the document.
  93.  This command is useful for opening a document prior to printing it.
  94.  
  95.  The `Close` command closes the currently open document.
  96.  This should be used before the current file is changed by another
  97.  program.
  98.  If you do not do this and Ghostview detects that the file length or date
  99.  have changed, it will close Ghostscript and rescan the document.
  100.  
  101.  See also `Print`.
  102. 2Page Selection
  103. ?Page Selection
  104. ?Next
  105. ?Prev
  106. ?Redisplay
  107. ?Goto
  108.  `Next` moves to the next page of a document.
  109.  This works even if the document does not contain `DSC` comments.
  110.  
  111.  `Prev` moves to the previous page.
  112.  
  113.  `Redisplay` redisplays the current page.
  114.  
  115.  `Goto` shows a dialog box which allows selection of the next page
  116.  number to display.  The `Select Page` dialog box shows page labels
  117.  since these are likely to be more useful than a sequential page number.
  118.  
  119.  The `Prev`, `Redisplay` and `Goto` commands work only if the
  120.  document contains `DSC` comments.
  121. 2Document Information
  122. ?Info
  123.  A brief information area at the top of the window is used by
  124.  Ghostview to display the document filename, the current page number
  125.  and label (if available) and while the cursor is over the image, the
  126.  location of the cursor in default user coordinates (1/72 inch).
  127.  The cursor location is useful for calculating bounding boxes.
  128.  
  129.  The `Info` command on the `File `menu shows a dialog box with the
  130.  following information about the `DSC` comments in the current document.
  131.  
  132.  `File `is the full pathname to the document.
  133.  
  134.  `Type` is` DSC`,` EPS` or `No DSC comments`.
  135.  `EPS` is an Encapsulated PostScript File - a single page document
  136.  that contains a subset of the `DSC` comments and PostScript commands.
  137.  `EPS `files are commonly used for inclusion in other documents.
  138.  
  139.  `Title` is a text title that can be used when printing banner
  140.  pages and for routing or recognising documents.
  141.  
  142.  `Date` is the time the document was created.
  143.  
  144.  `BoundingBox` specifies a box that encloses all the marks painted
  145.  on the page.  The four integer values are the coordinates of the
  146.  lower left and upper right corners of the bounding box in default
  147.  user coordinates (1/72 inch).
  148.  
  149.  `Orientation `is either `Portrait `or` Landscape`.
  150.  
  151.  `Default Media` gives the media name followed by the width and
  152.  height of that media in default user coordinates (1/72 inch).
  153.  
  154.  `Page Order` is either `Ascending`, `Descending` or `Special`
  155.  
  156.  `Pages` is the total number of pages in the document.
  157.  
  158.  `Page` gives the page label and page number.
  159.  
  160.  `Bitmap `is the size of the display bitmap in pixels which may be
  161.  useful if you are copying the displayed image to the clipboard.
  162. 2Printing
  163. ?Print
  164. ?Print To File
  165. ?Print File
  166. ?Extract
  167.  The `Print` command on the `File `menu allows printing of the document
  168.  using Ghostscript.
  169.  The Ghostscript printer driver and resolution are selected using the
  170.  `Select Device` dialog box.   Pages are selected using the `Select Pages`
  171.  dialog box.  The `All`, `Odd` and `Even` buttons provide quick selection
  172.  of pages.
  173.  
  174.  The `mswinprn` printer driver uses the windows printer drivers
  175.  and should work with any printer with raster capabilities.
  176.  Printer resolution cannot be selected from within Ghostview; use
  177.  the Control Panel instead.  This driver is very slow.
  178.  
  179.  With all other printer drivers, Ghostscript sends the output direct
  180.  to the printer, without passing through a Windows printer driver.
  181.  If you have trouble printing you may have to `Print To File`
  182.  and then `Print File` or use the DOS command `COPY /B FILENAME PRN`.
  183.  
  184.  This list of available devices and resolutions is stored in the
  185.  [Devices] section of gsview.ini.  The default list of devices
  186.  and resolutions is taken from the standard distribution version
  187.  of Ghostscript for Windows 2.6 and may not be complete.
  188.  
  189.  To print a document without displaying it, open the document
  190.  using `Select File`.
  191.  
  192.  `Print To File` is similar to the `Print` command except that Ghostscript
  193.  will write the output to a file instead of sending it to a printer.
  194.  
  195.  If you want to produce a bitmap, some useful drivers are
  196.  `bmpmono`, `bmp16`, `bmp16m` and `bmp256`.
  197.  
  198.  `Print File` sends a file to a local port, bypassing the Windows
  199.  printer drivers.
  200.  This is useful for sending a document to a PostScript printer,
  201.  or for sending an output file produced by Ghostscript to a printer.
  202.  
  203.  `Extract` allows a range of pages to be copied from the current
  204.  document to a new document.  For example, ten pages can be extracted
  205.  from the middle of the current document and written to another file,
  206.  which will later be sent to a printer.
  207.  
  208. 3Properties
  209. ?Properties
  210.  Some printer drivers allow extra properties to be specified.
  211.  If two sections are added to the gsview.ini file for these printer
  212.  drivers, Ghostview will enable the `Properties` button which will
  213.  display the `Edit Properties` dialog box.
  214.  The following example shows how to add property information
  215.  for the cdjcolor driver.
  216.  First add a section which gives the current values.
  217.  This section, after the first character is removed, gives the options
  218.  that will appear in the `Property` list box.
  219.  The first character is `s` for string or `d` for number.
  220.   [cdjcolor]
  221.   dBitsPerPixel=24
  222.   dDepletion=1
  223.   dShingling=2
  224.   dBlackCorrect=4
  225.  
  226.  Next add a section which gives the values to display in the
  227.  `Value` list box.
  228.   [cdjcolor values]
  229.   dBitsPerPixel=1,3,8,16,24
  230.   dDepletion=1,2,3
  231.   dShingling=0,1,2
  232.   dBlackCorrect=0,1,2,3,4,5,6,7,8,9
  233.  Ghostview will also add the value `[Not defined]` to the listbox.
  234.  
  235.  When you press the `OK` button in the `Edit Properties` dialog
  236.  box, the current settings are written to the gsview.ini file.
  237.  
  238.  When Ghostview prints a file, it will give Ghostscript the contents
  239.  of the [cdjcolor] section of gsview.ini as follows:
  240.   -dBitsPerPixel=24 -dDepletion=1 -dShingling=2 -dBlackCorrect=3
  241.  If the value of a property is `[Not defined]`, that property will
  242.  not be sent to Ghostscript.
  243.  
  244.  Some entries for the cdj family of drivers are supplied in the
  245.  property.ini file that comes with Ghostview.
  246. 3PS to EPS
  247. ?PS to EPS
  248.  In general, it is not possible to convert a PostScript file to `EPS`.
  249.  However, many single page PostScript files can be converted to `EPS`
  250.  by changing the first line of the file to
  251.   %!PS-Adobe-3.0 EPSF-3.0
  252.  and then adding or fixing up the `%%BoundingBox` comment.
  253.  
  254.  To convert a PostScript file to `EPS`, the original file `must` be
  255.  a `single page` document.  If the document contains `DSC` comments
  256.  and is multi page, extract the desired page with `File` | `Extract`.
  257.  If the document does not contain `DSC` comments, you will need to
  258.  edit the file by hand to extract the desired page.
  259.  
  260.  `EPS` documents `must not` use any of the following operators:
  261.   banddevice   clear         cleardictstack  copypage
  262.   erasepage    exitserver    framedevice     grestoreall
  263.   initclip     initgraphics  initmatrix      quit
  264.   renderbands  setglobal     setpagedevice   setpageparams
  265.   setshared    startjob      letter          note
  266.   legal        a3            a4              a5
  267.  
  268.  The following operators should be used with care:
  269.   nulldevice   setgstate     sethalftone    setmatrix
  270.   setscreen    settransfer   setcolortransfer
  271.  
  272.  It is `your` responsibility to make sure that the above requirements
  273.  are met.
  274.  
  275.  To test if a document contains any of the above operators, select
  276.  `Options` | `EPS Warn` and then `Open` the desired document.
  277.  After the page has been displayed, look in the Ghostscript text window.
  278.  If any of the above operators have been used you should see lines like:
  279.   Warning: EPS files must not use ...
  280.  If you find these warnings then do `not` use `PS to EPS`.
  281.  Remember to turn off `EPS Warn` afterwards.
  282.  
  283.  A document must be displayed before `PS to EPS` is used.
  284.  The document must contain a `showpage`.
  285.  This is required so that the bounding box can be measured.
  286.  
  287.  For documents without `DSC` comments, `PS to EPS` allows a bounding
  288.  box to be specified, then writes out an `EPS` file consisting of
  289.  an `EPS` wrapper around the original document.
  290.  
  291.  For documents with `DSC` comments, `PS to EPS` will change the
  292.  first line of the file to
  293.   %!PS-Adobe-3.0 EPSF-3.0
  294.  then allows the `%%BoundingBox` comment to be changed or added.
  295.  
  296.  For `EPS` documents, `PS to EPS` allows the `%%BoundingBox` comment to
  297.  be changed.
  298.  
  299.  See also `Add EPS Preview`, `Extract`, `EPS Warn`.
  300. 2Clipboard
  301. ?Clipboard
  302. ?Edit
  303. ?Copy
  304. ?Paste To
  305. ?Convert Bitmap
  306. ?Bitmap
  307. ?Add EPS Preview
  308. ?Extract EPS
  309.  The Ghostview window can be copied to the Clipboard as a bitmap
  310.  by selecting `Copy` from the `Edit` menu.
  311.  The bitmap may be a Device Independent Bitmap or it may be a Device
  312.  Dependent Bitmap, depending on how Ghostscript was compiled.
  313.  The default for Ghostscript 2.6 is a Device Independent Bitmap
  314.  (BMP format).
  315.  
  316.  An alternative way to get a bitmap output from Ghostscript is
  317.  to use one of the BMP drivers.  See `Print`.
  318.  
  319.  `Paste To` copies a Device Independent Bitmap from the Clipboard
  320.  (if available) to a BMP file.
  321.  
  322.  `Convert Bitmap` converts between a Device Independent Bitmap and
  323.  a Device Dependent Bitmap.
  324.  If the clipboard contains a Device Independent Bitmap (BMP format),
  325.  this is converted to a Device Dependent Bitmap and added to the clipboard.
  326.  If the clipboard does not contain a colour palette, one is created
  327.  from the Device Independent Bitmap and added to the clipboard.
  328.  This option is present because some applications (notably Windows
  329.  Paintbrush) won't recognise a Device Independent Bitmap in the clipboard.
  330.  
  331.  `Add EPS Preview` takes a bitmap from the clipboard and uses it to add
  332.  a preview to an EPS file.
  333.  `Add EPS Preview` can create a DOS EPS file with a Windows Metafile or
  334.  TIFF preview, or an EPSI file with an Interchange preview.
  335.  To use the `Add EPS Preview` command the following steps must be followed.
  336.  
  337.  1. Make sure the document has a correct bounding box.
  338.  A bounding box can be added or changed using `File` | `PS to EPS`.
  339.  
  340.  2. Select `Orientation` | `Portrait`.
  341.  
  342.  3. Select `Options` | `EPS Clip`.
  343.  This will cause Ghostscript to use a display window the size of the 
  344.  bounding box instead of the page size.
  345.  
  346.  4. Select `Media` | `Resolution` and set a suitable resolution
  347.  for the preview.  If the resolution is too high the bitmap may not
  348.  fit in the clipboard, or will make the EPS file excessively large.
  349.  
  350.  5. `Open` an EPS file that does not contain a preview.
  351.  
  352.  6. Select `Edit` | `Copy`.  This tells Ghostscript to copy the
  353.  display bitmap to the Clipboard.  This allows Ghostview to access
  354.  the bitmap in the next step.
  355.  
  356.  7. Select `Edit` | `Add EPS Preview`, then the preview format,
  357.  then the new EPS filename.  Ghostview will write a new file containing
  358.  the original PostScript EPS file and a preview created from the bitmap
  359.  in the clipboard.
  360.  The available preview formats are `Interchange`, `TIFF 4`, `TIFF 5`
  361.  and `Windows Metafile`.
  362.  If adding an Interchange preview, the document must have an `%%EndComments`
  363.  line, otherwise Ghostview may put the preview in the wrong place.
  364.  A TIFF 5 preview is a Class B image with no compression as described
  365.  in Appendix G of the TIFF 5.0 memorandum.  A TIFF 4 preview is almost
  366.  identical to the TIFF 5 preview, but avoids using tags which are not
  367.  described in the TIFF 4 specifiation.
  368.  WordPerfect 5.1 requires a TIFF 4 preview.
  369.  
  370.  8. Reset `Orientation` | `Portrait`, `Options` | `EPS Clip`
  371.  and `Media` | `Resolution` to their previous values.
  372.  
  373.  To extract the PostScript or Preview section from a DOS EPS
  374.  file, use `File` | `Select File` followed by `Edit` | `Extract EPS`
  375.  then `PostScript` or `Preview`.
  376.  
  377.  See also `PS to EPS`.
  378. 2Options
  379. ?Options
  380.  The `Options` menu has the following selections
  381. 3Ghostscript Command
  382. ?Ghostscript Command
  383.  The `Ghostscript Command` option allows selection of the command
  384.  to use when executing Ghostscript.  The default is `gswin`.
  385.  If Ghostscript is not in the Ghostview directory, or not on the
  386.  PATH, use this option to set the full pathname to Ghostscript.
  387.  If you wish to specify that Ghostscript should look for its
  388.  initialisation files in a different place, add a -I option to
  389.  the command as in the following example:
  390.   c:\gs\gswin -Ic:\gs;d:\psfonts
  391.  Try to keep the command length short, otherwise Ghostview will
  392.  have trouble printing files with Ghostscript.
  393.  Only the Ghostscript EXE and include path may be specified -
  394.  other items will confuse Ghostview.
  395. 3Sounds
  396. ?Sounds
  397.  The `Sounds` option assigns sounds to various events.
  398.  For each event the sound can be set to `None`, a `Speaker Beep` or
  399.  a `Wave` file.
  400.  
  401.  You must have a sound driver loaded before using Wave files.
  402.  Wave file sounds are not available under Windows 3.0.
  403.  
  404.  The events are:
  405.  
  406.  `Output Page`: the PostScript showpage operator was executed.
  407.  
  408.  `No Page`: an invalid page was selected.
  409.  For example, pressing `Prev` while on the first page of a document
  410.  with `DSC` comments.
  411.  
  412.  `No Number`: a command required page numbering and the document did
  413.  not have page numbering.
  414.  For example, pressing `Goto` when viewing a document without
  415.  `DSC` comments.
  416.  
  417.  `Not Open`:  a command required a document to be open and this was
  418.  not the case.
  419.  For example, pressing `Goto` when no document is open.
  420.  
  421.  `Error`: many types of errors.
  422.  
  423.  `Timeout`: no response from Ghostscript within a timeout period.
  424.  For example, display snowflak.ps on a PC with a 286-12 CPU.
  425.  
  426.  `Start`: Ghostview opened.
  427.  
  428.  `Exit`: Ghostview closed.
  429.  
  430.  The defaults are for `No Page` and `Error` to be a `Speaker Beep`
  431.  and all other events to be `None`.
  432. 3Save Settings
  433. ?Save Settings
  434. ?Settings
  435. ?INI file
  436. ?Save Settings on Exit
  437.  The `Save Settings` option saves the Ghostview window position,
  438.  window size, last used printer, last directory, `Save Last Directory`,
  439.  `User Defined`, `Ghostscript Command`, `Button Bar`, `Quick Open`,
  440.  `Auto Redisplay`, `EPS Clip`, `EPS Warn`, `Sounds`, `Orientation`,
  441.  `Media` and `Resolution` options to the file gsview.ini in the
  442.  windows directory.
  443.  Ghostview reads gsview.ini during startup.
  444.  
  445.  When the `Save Settings on Exit` option is checked, Ghostview will
  446.  automatically save the above settings when you quit Ghostview.
  447. 3Save Last Directory
  448. ?Save Last Directory
  449.  When the `Save Last Directory` option is `checked`, Ghostview will
  450.  save the current directory when you quit Ghostview.  When Ghostview
  451.  is started next, this will be made the current directory.
  452.  This is the default.
  453.  
  454.  When `Save Last Directory` option is `unchecked`, the current
  455.  directory when Ghostview is started will be the directory where
  456.  Ghostview is located, or the working directory specified by
  457.  the Program Manager.
  458. 3Button Bar
  459. ?Button Bar
  460.  When the `Button Bar` option is `checked`, Ghostview will display
  461.  a Button Bar down the left side of the window.  This is the default.
  462.  The Button Bar contains the following items:
  463.  
  464.  `File` | `Open`
  465.  
  466.  `File` | `Print`
  467.  
  468.  `File` | `Info`
  469.  
  470.  `Help` | `Contents`
  471.  
  472.  `File` | `Goto`
  473.  
  474.  `File` | `Next`
  475.  
  476.  `File` | `Prev`
  477.  
  478.  `Go forward 5 pages`
  479.  
  480.  `Go back 5 pages`
  481.  
  482.  When the `Button Bar` option is `unchecked`, Ghostview will not
  483.  display the Button Bar.
  484. 3Quick Open
  485. ?Quick Open
  486.  When the `Quick Open` option is `checked`, Ghostview will not reload
  487.  Ghostscript before every document, making opening of documents quicker.
  488.  
  489.  Ghostview tries to preserve the Ghostscript state between documents,
  490.  but a document may still leave the Ghostscript interpreter in an unusual
  491.  state or cause an error.  If an error occurs, Ghostscript will close.
  492.  Error messages are displayed in the Ghostscript window.
  493.  Select `Redisplay` to reopen the document.
  494.  
  495.  If `Quick Open` is `unchecked`, Ghostview will close Ghostscript and
  496.  restart it before each new document or whenever the page orientation,
  497.  resolution or size is changed.
  498. 3Auto Redisplay
  499. ?Auto Redisplay
  500.  When the `Auto Redisplay` option is `checked`, Ghostview will
  501.  redisplay `DSC` documents when the `Orientation`, `Resolution`
  502.  or `Media` are changed.
  503.  
  504.  If `Auto Redisplay` is `unchecked`, the `File` | `Redisplay` command
  505.  must be used to redisplay a document after changing the
  506.  `Orientation`, `Resolution` or `Media`.  This is the default.
  507. 3EPS Clip
  508. ?EPS Clip
  509.  When the `EPS Clip` option is `checked`, Ghostview will clip the
  510.  display bitmap to the bounding box of an EPS file instead of using the
  511.  page size specified on the `Media` menu.  This is useful when
  512.  adding a bitmap preview to an EPS file.
  513.  
  514.  If `EPS Clip` is `unchecked`, Ghostview will use the page size
  515.  specified on the `Media` menu for EPS files.  This is the default.
  516.  
  517.  See also `Clipboard` | `Add EPS Preview`
  518. 3EPS Warn
  519. ?EPS Warn
  520.  When the `EPS Warn` option is `checked`, Ghostview will write a
  521.  prolog to Ghostscript when each file is opened.  This prolog will
  522.  produce warning messages in the Ghostscript text window if any
  523.  PostScript operators that should not be used in `EPS` files
  524.  are used.  An example warning message is:
  525.   Warning: EPS files must not use /initgraphics
  526.  `EPS Warn` is not infallible.  It is possible to access restricted
  527.  operators without `EPS Warn` producing a warning.
  528.  
  529.  The default for `EPS Warn` is `unchecked`.
  530.  
  531.  See also `PS to EPS`.
  532. 2Page Orientation
  533. ?Orientation
  534. ?Portrait
  535. ?Landscape
  536. ?Upside-down
  537. ?Seascape
  538. ?Swap Landscape
  539.  The `Portrait`, `Landscape`, `Upside-down` and `Seascape`
  540.  (reverse Landscape) commands on the `Orientation `Menu select
  541.  the page orientation used by the display.
  542.  `Landscape` implies a clockwise rotation of the paper by 90 degrees.
  543.  `Seascape` implies an anti-clockwise rotation of the paper by 90 degrees.
  544.  These orientation options only affect the display and do not affect
  545.  the print commands.
  546.  If a `DSC` page orientation comment is found, the orientation will be
  547.  selected automatically.
  548.  
  549.  When the `Swap Landscape` option is `checked`, Ghostview swaps the
  550.  meaning of Landscape and Seascape.
  551.  Most of the Landscape documents that I have encountered require a 90
  552.  clockwise rotation of the paper to view.
  553.  However, there is no standard and some documents need to be rotated
  554.  the other way.
  555.  The `Swap Landscape` button allows Ghostview to automatically rotate the
  556.  document the right way in response to the `%%Orientation` comment in the
  557.  PostScript file.
  558. 2Page Size and Display Resolution
  559. ?Resolution
  560. ?Media
  561. ?Page Size
  562. ?User Defined
  563.  The `Resolution` command on the `Media` menu selects the display
  564.  resolution in dots per inch.
  565.  The default for a VGA display is 96 dots per inch.
  566.  
  567.  The `Media` menu also allows selection of page size.
  568.  Available page sizes are:
  569.   Letter          8.5 x 11   inch
  570.   Tabloid        11   x 17   inch
  571.   Ledger         17   x 11   inch
  572.   Legal           8.5 x 14   inch
  573.   Statement       5.5 x  8.5 inch
  574.   Executive       7.5 x 10   inch
  575.   A3              297 x 420  mm
  576.   A4              210 x 297  mm
  577.   A5              148 x 210  mm
  578.   B4              257 x 364  mm
  579.   B5              182 x 257  mm
  580.   Folio           8.5 x 13   inch
  581.   Quarto          8.5 x 10.8 inch
  582.   10x14          10   x 14   inch
  583.  
  584.  A user defined size can be specified in PostScript points (1/72 inch)
  585.  with the `User Defined` command.  A size of 480x360 points at 96 dpi
  586.  will give an image size of 640x480 pixels.
  587.  
  588.  If a `DSC` media comment is found, the page type will be selected
  589.  automatically.  If the media specification is not one of the above
  590.  page types, the `User Defined` size will be set.
  591. 2Running Ghostview from the File Manager
  592. ?Registration Info Editor
  593. ?File Manager
  594.  To run Ghostview when a PostScript file is double clicked in the
  595.  File Manager, the following sequence must be followed to teach
  596.  File Manager about PostScript files.
  597.  
  598.  From the `Program Manager`, run the Registration Info Editor using
  599.  `File `| `Run...` then type `regedit`.
  600.  From the `Registration Info Editor` select `Edit `| `Add File Type...`
  601.  then enter the following fields:
  602.   Identifier = psfile
  603.   Filetype = PostScript
  604.   Action = Open
  605.   Command = gsview %1
  606.   Uses DDE = unchecked
  607.   Action = Print
  608.   Command = gsview /p %1
  609.   Uses DDE = unchecked
  610.  Then press `OK`.
  611.  
  612.  From the `File Manager`, select `File `| `Associate` then
  613.  enter the following fields:
  614.   Files with Extension = ps
  615.   Associate With = PostScript (gsview)
  616.  Then press `OK`.
  617.  
  618.  Put gsview.exe and gsview.hlp in a directory on your PATH.
  619.  That's it!  Now when you double click on a PostScript file,
  620.  the `File Manager` will run Ghostview.  When you drop a PostScript
  621.  file on the `Print Manager`, Ghostview will print the file.
  622. 2Copyright
  623. ?Copyright
  624.  The `About` menu item shows the Ghostview copyright message
  625.  and Ghostview version number.
  626.  
  627.   GSVIEW.EXE - A Ghostscript graphical interface
  628.   Copyright (C) 1993  Russell Lang
  629.  
  630.  This program is free software; you can redistribute it and/or modify
  631.  it under the terms of the GNU General Public License as published by
  632.  the Free Software Foundation; either version 2 of the License, or
  633.  (at your option) any later version.
  634.  
  635.  This program is distributed in the hope that it will be useful,
  636.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  637.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  638.  GNU General Public License for more details.
  639.  
  640.  You should have received a copy of the GNU General Public License
  641.  along with this program; if not, write to the Free Software
  642.  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  643.  
  644.      Author: Russell Lang
  645.    Internet: rjl@monu1.cc.monash.edu.au
  646.  
  647.  ps.c module Copyright (C) 1992 Tim Theisen (tim@cs.wisc.edu).
  648. 2Common Problems
  649. ?Problems
  650.  `Problem:` Ghostview can't run gswin.
  651.  
  652.  Ghostview requires Ghostscript for Windows (gswin.exe).
  653.  If you don't have Ghostscript for Windows, it is hardly suprising
  654.  that Ghostview can't run it.
  655.  
  656.  From the Ghostview menu select `Options` | `Ghostscript Command`
  657.  and enter the correct executable path and include path for Ghostscript.
  658.  For example:
  659.   c:\gs\gswin.exe -Ic:\gs
  660.  
  661.  The default Ghostscript Command is `gswin`.  This will work if
  662.  Ghostscript is in the same directory as Ghostview, or if the
  663.  Ghostscript directory is on the PATH.
  664.  
  665.  Make sure you don't already have Windows Ghostscript running.
  666.  Only one copy of Windows Ghostscript can be running at a time.
  667.  Only one copy of Ghostview can be running at a time.
  668.  
  669.  `Problem:` Ghostscript starts and then immediately exits with error code 1.
  670.  
  671.  Read the error message in the Ghostscript window before pressing OK
  672.  in the message box.
  673.  
  674.  Ghostscript probably couldn't find its initialisation files.
  675.  Set the environment variable GS_LIB to the directory containing
  676.  the Ghostscript initialisation files, or add -Idirectory to the command
  677.  in `Options` | `Ghostscript Command`.
  678.  
  679.  Read the file use.doc that comes with Ghostscript.
  680.  
  681.  `Problem:` Message Box says `Incompatible Windows Ghostscript`
  682.  
  683.  You probably have an earlier version of Ghostscript.
  684.  Make sure you have Ghostscript version 2.6 or later.
  685.  
  686.  `Problem:` Ghostview says 'wait' and shows an hourglass cursor.
  687.  When the cursor is moved off the Ghostview window it changes to a
  688.  normal arrow.
  689.  
  690.  The above state is normal while Ghostview is waiting for Ghostscript
  691.  to do something.  It may be that the document is very complex and
  692.  Ghostscript is just taking a long time.  In this state it is safe to
  693.  resize or scroll the window, but do not select any menu commands.
  694.  
  695.  If this is not the case then Ghostview probably got no response
  696.  from Ghostscript.
  697.  Open the Ghostscript text window and look at any error messages.
  698.  Close Ghostscript using the Ghostscript system menu.
  699.  If Ghostview is still waiting, press the Ghostview Open button
  700.  (even though the cursor is still an hourglass).
  701.  Press the 'Yes' button on the 'gsview is busy' message box.
  702.  Ghostview should then revert to the non-waiting mode.
  703.  
  704.  `Problem:` Ghostview says that a multipage postscript file produced by
  705.  Word for Windows contains 0 pages and will only show the first page.
  706.  
  707.  This is because the document does not have correct DSC comments.
  708.  From the Control Panel, select `Printers`, `Options...`, `Advanced` and
  709.  then check the `Conform to Adobe Document Structuring Convention`.
  710.  
  711.  The DSC comment `%%Pages: 0` means that the document does not produce
  712.  any pages.  That is, the PostScript `showpage` operator is not used.
  713.  If you find a PostScript document that has multiple pages and contains
  714.  the `%%Pages: 0` comment, change the first line from `%!-PS-Adobe-` to `%!`.
  715.  Ghostview will then ignore the DSC comments and allow you to view all
  716.  pages, but only in the original order.  Complain to the author of the
  717.  program that produced that PostScript file.
  718.  
  719.  `Problem:` PostScript files produced by Windows start with a Control-D.
  720.  
  721.  Since this occurs even when the PostScript printer
  722.  `Conform to Document Structuring Convention`
  723.  checkbox is checked, this must be considered a
  724.  bug in the Windows PostScript printer driver.
  725.  The solution is documented in the Windows PRINTERS.WRI file.
  726.  Edit the win.ini file and search for the postscript printer section.
  727.  There may be more than one.  In each of these sections add
  728.  `CTRLD=0` as shown below.
  729.  
  730.   [Apple LaserWriter II NT,FILE]
  731.   CTRLD=0
  732.  
  733.  `Problem:` Ghostscript always outputs to a printer instead of the
  734.  Ghostview window.
  735.  
  736.  You must not use the GS_DEVICE environment variable.
  737.  
  738. 2Internals
  739. ?Internals
  740.  The preferred method for driving Ghostscript would be to start it
  741.  as a child process and then to send it postscript code through a pipe.
  742.  Windows 3.1 supports neither child processes nor pipes.
  743.  
  744.  Ghostview interacts with Ghostscript by sending messages between
  745.  the Ghostview and Ghostscript windows.
  746.  Ghostview creates an imitation pipe to Ghostscript by writing
  747.  into a shareable global memory block and then passing the handle
  748.  to Ghostscript.
  749.  
  750.  Ghostview starts Ghostscript for displaying using
  751.   gswin -rXDPIxYDPI -gWIDTHxHEIGHT -sGSVIEW=xxxx -
  752.  where xxxx is the handle to the Ghostview window.
  753.  Ghostscript then tells Ghostview the handle to the text window by sending
  754.  a message WM_USER with wParam HWND_TEXT=0 to the Ghostview window.
  755.  Instead of creating another window for the image, Ghostscript
  756.  creates a child window of the Ghostview window for displaying
  757.  the bitmap. Ghostscript tells Ghostview the handle to this child
  758.  image window by sending a message WM_USER with wParam
  759.  HWND_IMGCHILD=1.
  760.  
  761.  Ghostscript also sends WM_USER messages to Ghostview with wParam
  762.  GSWIN_CLOSE=2 when it is exiting,
  763.  SYNC_OUTPUT=3 when the image needs to be redrawn (win_sync_output),
  764.  OUTPUT_PAGE=4 when a page is to be output (win_output_page),
  765.  SCROLL_POSITION=5 when the window is scrolled and
  766.  PIPE_DATA=6 for passing the handle to a global memory block (in
  767.  lParam) for the imitation pipe.
  768.  
  769.  When Ghostscript sends the OUTPUT_PAGE command it waits until it
  770.  receives a NEXT_PAGE command from Ghostview.
  771.  
  772.  Ghostview sends WM_USER messages to the Ghostscript Image window with
  773.  wParam NEXT_PAGE=10 when it is time to move to the next page and
  774.  COPY_CLIPBOARD=11 when the bitmap should be copied to the clipboard.
  775.  Ghostview sends WM_USER messages to the Ghostscript Text window with
  776.  wParam PIPE_REQUEST=12 when it wants more pipe data.
  777.  
  778.  Ghostview uses temporary files of the name gsviewXX.XXX in the
  779.  directory given by the TEMP environment variable.
  780.  Keep TEMP short to avoid the gswin command line exceeding 128 characters.
  781.  
  782.  Ghostview starts Ghostscript for printing using
  783.   gswin -sGSVIEW=xxxx @optfile filename.ps quit.ps
  784.  optfile contains
  785.   -dNOPAUSE
  786.   -sDEVICE=devname
  787.   -rXDPIxYDPI
  788.   -gWIDTHxHEIGHT
  789.   -sOutputFile=filename
  790.  
  791.  To start Ghostview and display filename.ps use:
  792.   gsview filename.ps
  793.  To start Ghostview and print filename.ps using Ghostscript use:
  794.   gsview /P filename.ps
  795.  To start Ghostview and print filename.ps to a file using Ghostscript use:
  796.   gsview /F filename.ps
  797.  To start Ghostview in debug mode use:
  798.   gsview /D
  799.  In debug mode Ghostview will `not` remove its temporary files.
  800.  This is to allow inspection of these files after Ghostview has finished.
  801.  
  802.  The ability to select individual pages for an Adobe Document
  803.  Structuring Conventions conforming document is due to the inclusion of
  804.  the ps.c module from X11 Ghostview by Tim Theisen (ghostview@cs.wisc.edu).
  805.  Don't send mail to Tim about Ghostview for Windows, unless it is about a
  806.  bug in the ps.c module.
  807.